<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>静态方法和静态属性</h1>
    <script>
        class Stu {
            // 普通属性，会被子类继承
            add = 'Zhengzhou-gangqu';
            // 静态属性
            static name = 'Tom'
            // 普通方法，会被子类继承
            sayHi() {
                console.log('Hi~');
            }
            // 静态方法-子类不会继承的方法
            static sayHello() {
                console.log('Hello~');
            }
        }

        let stu1 = new Stu();
        stu1.sayHi()
        Stu.sayHello()
        console.log(stu1.add);
        console.log(Stu.name);
    </script>
</body>
</html>